/* vue */
import { defineComponent } from "vue";
/* mixin */
import VersionControlBaseMixin from '@src/mixins/versionControlMixin/base';
/* util */
import { isFalsy } from "@src/util/type";
/* version product */
import {
  isShowProductType,
  isShowProductTemplate,
  isShowProductQuality,
  isShowProductSuperQrcode,
  isShowProductSuperQrcodeSetting,
  isShowProductRemind,
  isShowProductSendActivitySurvey,
  isShowProductSendEmail,
  isShowProductSendSMS,
  isShowProductRegister,
  isShowProductQrcode
} from '@shb-lib/version'

export default defineComponent({
  name: "version-control-product-mixin",
  mixins: [VersionControlBaseMixin],
  computed: {
    productVersionControl(): Record<string, boolean> {
      return {
        isShowProductType: isShowProductType(this._versionControlMap),
        isShowProductTemplate: isShowProductTemplate(this._versionControlMap),
        isShowProductQuality: isShowProductQuality(this._versionControlMap),
        isShowProductSuperQrcode: isShowProductSuperQrcode(this._versionControlMap),
        isShowProductQrcode: isShowProductQrcode(this._versionControlMap),
        isShowProductSuperQrcodeSetting: isShowProductSuperQrcodeSetting(this._versionControlMap),
        isShowProductRemind: isShowProductRemind(this._versionControlMap),
        isShowProductSendActivitySurvey: isShowProductSendActivitySurvey(this._versionControlMap),
        isShowProductSendEmail: isShowProductSendEmail(this._versionControlMap),
        isShowProductSendSMS: isShowProductSendSMS(this._versionControlMap),
        isShowProductRegister: isShowProductRegister(this._versionControlMap)
      }
    },
    _isShowProductType(): boolean {
      return this.productVersionControl.isShowProductType
    },
    _isNotShowProductType(): boolean {
      return isFalsy(this.productVersionControl.isShowProductType)
    },
    _isShowProductTemplate(): boolean {
      return this.productVersionControl.isShowProductTemplate
    },
    _isShowProductQuality(): boolean {
      return this.productVersionControl.isShowProductQuality
    },
    _isShowProductSuperQrcode(): boolean {
      return this.productVersionControl.isShowProductSuperQrcode
    },
    _isShowProductSuperQrcodeSetting(): boolean {
      return this.productVersionControl.isShowProductSuperQrcodeSetting
    },
    _isShowProductQrcode(): boolean {
      return this.productVersionControl.isShowProductQrcode
    },
    _isShowProductRemind(): boolean {
      return this.productVersionControl.isShowProductRemind
    },
    _isShowProductSendActivitySurvey(): boolean {
      return this.productVersionControl.isShowProductSendActivitySurvey
    },
    _isShowProductSendEmail(): boolean {
      return this.productVersionControl.isShowProductSendEmail
    },
    _isShowProductSendSMS(): boolean {
      return this.productVersionControl.isShowProductSendSMS
    },
    _isShowProductRegister(): boolean {
      return this.productVersionControl.isShowProductRegister
    }
  }
})
